package com.etoak.controller;


import com.etoak.common.core.vo.ResultVO;
import com.etoak.entity.Dict;
import com.etoak.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.Type;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author et2403
 * @since 2024-08-12
 */
@RestController
@RequestMapping("/dict")
public class DictController {

    @Autowired
    DictService dictService;

    @GetMapping("/list")
    public ResultVO<List<Dict>> getList(@RequestParam String type) {
        List<Dict> dictList = dictService.getDictList(type);
        if (!dictList.isEmpty() || dictList != null) {
            return ResultVO.success(dictList);
        } else {
            return ResultVO.failed();
        }
    }
}

